<template>
    <view class="list">
        <view class="item" v-for="(item, index) in data" :key="index" @tap="$toPage('detail')">
            <image :src="item.goods_thumb" mode="aspectFit"></image>
            <view class="info">
                <view class="name">{{ item.name }}</view>
                <view class="tip">{{ item.goods_tip }}</view>
                <view class="price">￥{{ item.goods_price }}</view>
            </view>
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                data: [
                    { id: 1, name: '国庆大促', goods_tip: '详情详情详情详情详情详情详情', goods_thumb: 'https://cdn.uviewui.com/uview/swiper/swiper1.png', comment_count: '内容', goods_price: '2000' },
                    { id: 2, name: '国庆大促', goods_tip: '详情详情详情详情详情详情详情', goods_thumb: 'https://cdn.uviewui.com/uview/swiper/swiper1.png', comment_count: '内容', goods_price: '2000' },
                ]
            };
        },
    };
</script>

<style lang="scss" scoped>
    .list {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        background: #fff;
        padding: 0 10px;
        box-sizing: border-box;

        .item {
            display: flex;
            width: 100%;
            margin-bottom: 10px;

            image {
                width: 100px;
                height: 100px;
                margin-right: 10px;
            }

            .info {
                display: flex;
                flex-direction: column;
                justify-content: space-around;

                .name {
                    font-size: 16px;
                    font-weight: bold;
                }

                .tip {
                    font-size: 14px;
                    color: #999;
                }

                .price {
                    font-size: 16px;
                    color: #f00;
                }
            }
        }
    }
</style>
